module.exports = class StockEnum {
	//**[sh_a:沪A,sh_b:沪B,sz_a:深A,sz_b:深B,hs_a:沪深A,hs_b沪深B]**
	static get EXCHANGE_CODE_SH() {
		return "sh"
	}
	static get EXCHANGE_NAME_SH() {
		return "上海证券交易所"
	}
	static get EXCHANGE_CODE_SZ() {
		return "sz"
	}
	static get EXCHANGE_NAME_SZ() {
		return "深圳证券交易所"
	}
	static get TYPE_CODE_SH_A() {
		return `${this.EXCHANGE_CODE_SH}_a`
	}
	static get TYPE_NAME_SH_A() {
		return "沪A"
	}
	static get TYPE_CODE_SH_B() {
		return `${this.EXCHANGE_CODE_SH}_b`
	}
	static get TYPE_NAME_SH_B() {
		return "沪B"
	}
	static get TYPE_CODE_SZ_A() {
		return `${this.EXCHANGE_CODE_SZ}_a`
	}
	static get TYPE_NAME_SZ_A() {
		return "深A"
	}
	static get TYPE_CODE_SZ_B() {
		return `${this.EXCHANGE_CODE_SZ}_b`
	}
	static get TYPE_NAME_SZ_B() {
		return "深B"
	}
	static get TYPE_CODE_HS_A() {
		return "hs_a"
	}
	static get TYPE_NAME_HS_A() {
		return "沪深A"
	}
	static get TYPE_CODE_HS_B() {
		return `hs_b`
	}
	static get TYPE_NAME_HS_B() {
		return "沪深B"
	}

	static map(code) {
		const map = new Map([
			[
				this.EXCHANGE_CODE_SH,
				this.EXCHANGE_NAME_SH
			],
			[
				this.EXCHANGE_CODE_SZ,
				this.EXCHANGE_NAME_SZ
			],
			[
				this.TYPE_CODE_SH_A,
				this.TYPE_NAME_SH_A
			],
			[
				this.TYPE_CODE_SH_B,
				this.TYPE_NAME_SH_B
			],
			[
				this.TYPE_CODE_SZ_A,
				this.TYPE_NAME_SZ_A
			],
			[
				this.TYPE_CODE_SZ_B,
				this.TYPE_NAME_SZ_B
			],
			[
				this.TYPE_CODE_HS_A,
				this.TYPE_NAME_HS_A
			],
			[
				this.TYPE_CODE_HS_B,
				this.TYPE_NAME_HS_B
			],
		]);
		return map.get(code);
	}

}
